package com.itheima.demo.demo11;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Client1 {
    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("192.168.35.37",8888);
        OutputStream os = socket.getOutputStream();
        os.write("你好，我是客户端".getBytes());

        InputStream is = socket.getInputStream();
        int len=0;
        byte[]b=new byte[1024];
        while ((len=is.read(b))!=-1){
            System.out.println("系统"+new String(b,0,len));
        }



        is.close();
        os.close();
        socket.close();
    }
}
